var moveZeroes = function(nums) {
  let fast = 0, slow = 0;

  while (fast < nums.length) {
    if (nums[fast] == 0) {
      fast++;
    } else {
      nums[slow++] = nums[fast++];
    }
  }

  while (slow < nums.length) {
    nums[slow++] = 0;
  }
}